<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading bg-orange">
                <h3 class="panel-title"><strong>Danh sách </strong> User</h3>
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-md-12 m-b-20">
                        <a href="<?php echo Yii::app()->createUrl('/backend/users/update'); ?>" title="Thêm User">
                        <div class="btn-group">
                            <button class="btn btn-danger" id="table-edit_new">
                                <i class="fa fa-plus"></i> Thêm User
                            </button>
                        </div></a>
                        <!--<div class="btn-group pull-right">
                            <button data-toggle="dropdown" class="btn btn-default dropdown-toggle">Tools <i class="fa fa-angle-down"></i>
                            </button>
                            <ul class="dropdown-menu pull-right">
                                <li><a href="#">In</a>
                                </li>
                                <li><a href="#">Xuất file PDF</a>
                                </li>
                                <li><a href="#">Xuất file Excel</a>
                                </li>
                            </ul>
                        </div>-->
                    </div>
                    <!-- end col -->
                    <div class="col-md-12 col-sm-12 col-xs-12 table-responsive table-orange">
                        <div role="grid" class="dataTables_wrapper form-inline" id="DataTables_Table_0_wrapper">
                            <div class="row">
                                <!--<div class="col-xs-6">
                                    <div id="DataTables_Table_0_length" class="dataTables_length">
                                        <label><select name="DataTables_Table_0_length" size="1" class="form-control" aria-controls="DataTables_Table_0">
                                                <option value="10" selected="selected">10</option>
                                                <option value="25">25</option>
                                                <option value="50">50</option>
                                                <option value="100">100</option>
                                            </select> </label></div>
                                </div>
                                <div class="col-xs-6">
                                    <div class="dataTables_filter" id="DataTables_Table_0_filter"><label><i class="fa fa-search"></i>
                                            <input type="text" class="form-control" aria-controls="DataTables_Table_0"></label></div>
                                </div>
                                -->
                            </div>
                            <?php $this->widget('zii.widgets.grid.CGridView', array(
                                    'id' => 'users-grid',
                                    'dataProvider' => $model->search(),
                                    'filter' => $model,
                                    'itemsCssClass' => 'table f-14 table-striped table-hover dataTable table-dynamic',
                                    'summaryCssClass' => 'col-xs-6',
                                    'summaryText' => '<div class="dataTables_info" id="DataTables_Table_0_info">Hiện {start} - {end} trong {count} dữ liệu</div>',
                                    'pagerCssClass' => 'col-xs-6 dataTables_paginate paging_bootstrap',
                                    'pager' => array(
                                        'header' => '',
                                        'selectedPageCssClass'=>'active',////default "selected"
                                        'hiddenPageCssClass'=>'disabled',//default "hidden"
                                        'htmlOptions'=>array('class'=>'pagination'),
                                        //'internalPageCssClass' => 'pagination' // page for li
                                        'maxButtonCount'=>2,//defalut 10
                                        'firstPageLabel'=>'<i class="fa fa-angle-double-left"></i>',
                                        'prevPageLabel'=>'<i class="fa fa-angle-left"></i>',
                                        'nextPageLabel'=>'<i class="fa fa-angle-right"></i>',
                                        'lastPageLabel'=>'<i class="fa fa-angle-double-right"></i>',
                                    ),
                                    //the same for our entire grid. Note that this value can be set to "false"
                                    //if you set this to false, you'll have to include the styles for grid in some of your css files
//                                    'cssFile'=>false,
                                    'template'=>"{items}\n{summary}\n{pager}",
                                    'columns' => array(
                                        'fullname',
                                        'email',
                                        'phone',
                                        array(
                                            'name' => 'status',
                                            'value' => 'Lookup::item("STATUS", $data->status)'
                                        ),
                                        array(
                                            'name' => 'permission',
                                            'value' => 'Lookup::item("ROLE", $data->permission)'
                                        ),
                                        /*
                                        'id',
                                        'gender',
                                        'username',
                                        'password',
                                        'regdate',
                                        'avatar',
                                        */
                                        array(
                                            'class' => 'CButtonColumn',
                                            'template'=>'{update}',

                                            /*'buttons'=>array(
                                                'update' => array(
                                                    'label'=>'<i data-original-title="Sửa" rel="tooltip" title="" class="fa fa-pencil-square-o f-16 c-dark"></i>',
                                                    'url'=>'"#"',
                                                    'click'=>'function(){
                                                        $("#edit-user").addClass("in").toggleClass("active");
                                                            var gridName = "' . Yii::app()->controller->id . '";
                                                        $.ajax({
                                                            url: "' . Yii::app()->createUrl("/backend/users/update") . '",
                                                            type: "post",
                                                            data: { "id": $(this).val() },
                                                            success: function(){
                                                                $.fn.yiiGridView.update(gridName + "-grid");
                                                            }
                                                        });
                                                    }',
                                                    'options' => array(
                                                        'rel' => 'tooltip',
                                                        'data-toggle' => 'modal',
                                                        'title'       => 'Update',
                                                    ),
                                                ),
                                            ),*/
                                        ),
                                    ),
                                )
                            ); ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>